package com.cmwa.solution.business.demand.entity;

import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.type.Alias;

import com.cmwa.solution.base.entity.BaseVo;
import com.cmwa.solution.utils.cached.DictionaryCached;

@Alias("prdDemandVo")
public class PrdDemandVo extends BaseVo {

	/**
	 * 产品需求ID
	 */
	private String demandId;

	/**
	 * 需求标题
	 */
	private String title;

	/**
	 * 需求类型
	 */
	private String type;

	/**
	 * 需求类型(中文名)
	 */
	private String typeNM;

	/**
	 * 产品期限
	 */
	private String prdTerm;

	/**
	 * 参考收益
	 */
	private String refProfit;

	/**
	 * 投资范围
	 */
	private String investDesc;

	/**
	 * 材料类型
	 */
	private String materialType;

	/**
	 * 材料类型(中文名)
	 */
	private String materialTypeNM;

	/**
	 * 需求处理人ID
	 */
	private String managerId;

	/**
	 * 需求处理人名称
	 */
	private String companyName;

	/**
	 * 备注
	 */
	private String remark;

	/**
	 * 附件ID
	 */
	private String attIds;

	private String statusNm;

	private String beginTime;

	private String endTime;

	public String getDemandId() {
		return demandId;
	}

	public void setDemandId(String demandId) {
		this.demandId = demandId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getPrdTerm() {
		return prdTerm;
	}

	public void setPrdTerm(String prdTerm) {
		this.prdTerm = prdTerm;
	}

	public String getRefProfit() {
		return refProfit;
	}

	public void setRefProfit(String refProfit) {
		this.refProfit = refProfit;
	}

	public String getInvestDesc() {
		return investDesc;
	}

	public void setInvestDesc(String investDesc) {
		this.investDesc = investDesc;
	}

	public String getMaterialType() {
		return materialType;
	}

	public void setMaterialType(String materialType) {
		this.materialType = materialType;
	}

	public String getTypeNM() {
		if (StringUtils.isNotEmpty(type)) {
			return DictionaryCached.getInstance().getDictionaryName("PRD_DEMAND_TYPE", "PRD_DEMAND_TYPE",
					"PRD_DEMAND_TYPE", type);
		}
		return typeNM;
	}

	public void setTypeNM(String typeNM) {
		this.typeNM = typeNM;
	}

	public String getMaterialTypeNM() {
		if (StringUtils.isNotEmpty(materialType)) {
			String[] mTypes = materialType.split(",");
			materialTypeNM = "";
			for (String mType : mTypes) {
				materialTypeNM += DictionaryCached.getInstance().getDictionaryName("D_MATERIAL_TYPE", "D_MATERIAL_TYPE",
						"D_MATERIAL_TYPE", mType) + ",";
			}
			if (materialTypeNM.length() > 0) {
				materialTypeNM = materialTypeNM.substring(0, materialTypeNM.length() - 1);
			}
		}
		return materialTypeNM;
	}

	public void setMaterialTypeNM(String materialTypeNM) {
		this.materialTypeNM = materialTypeNM;
	}

	public void setStatusNm(String statusNm) {
		this.statusNm = statusNm;
	}

	@Override
	public String getStatusNm() {
		if (StringUtils.isNotBlank(status)) {
			return DictionaryCached.getInstance().getDictionaryName("PRD_DEMAND_STATUS", "PRD_DEMAND_STATUS",
					"PRD_DEMAND_STATUS", status);
		}
		return statusNm;
	}

	public String getManagerId() {
		return managerId;
	}

	public void setManagerId(String managerId) {
		this.managerId = managerId;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getAttIds() {
		return attIds;
	}

	public void setAttIds(String attIds) {
		this.attIds = attIds;
	}

	public String getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

}
